from docx import Document
from openpyxl import Workbook

document_path = '/home/HUAWEI/Desktop/2025年07月03日 python学习 读取docx文件表格会写到excel表格中/python测试文件.docx'

warnString = "================================================================================================================================================================================"

doc = Document(document_path)
print(warnString)
print('段落数为', len(doc.paragraphs))
print(warnString)

# 段落测试
for paragraph in doc.paragraphs:
    print(paragraph.text)
print(warnString)

# 文字块测试
for i in range(len(doc.paragraphs)):
    for run0 in doc.paragraphs[i].runs:
        print(run0.text)
        print(warnString)

# 添加段落测试
# doc.add_paragraph("添加段落测试")
# doc.add_paragraph("春江测试来回跑")
# doc.save(path)

workBook = Workbook()
